home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 8.0 KB | 307 lines | [TEXT/MPS ] |
- ;
- ; File: Patches.a
- ;
- ; Contains: Patch Manager Interfaces.
- ;
- ; Version: Technology: System 8
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__PATCHES__') = 'UNDEFINED' THEN
- __PATCHES__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF &TYPE('__KERNEL__') = 'UNDEFINED' THEN
- include 'Kernel.a'
- ENDIF
- IF &TYPE('__ORDEREDITEMS__') = 'UNDEFINED' THEN
- include 'OrderedItems.a'
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
-
- kOSTrapType EQU 0
- kToolboxTrapType EQU 1
- ; typedef SignedByte TrapType
-
-
- OSTrap EQU 0 ; old name
- ToolTrap EQU 1 ; old name
- ;
- ; GetTrapAddress and SetTrapAddress are obsolete and should not
- ; be used. Always use NGetTrapAddress and NSetTrapAddress instead.
- ; The old routines will not be supported for PowerPC apps.
- ;
- IF ¬ GENERATINGCFM THEN
- ;
- ; pascal UniversalProcPtr GetTrapAddress(UInt16 trapNum)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetTrapAddress: OPWORD $A146
- ELSE
- IMPORT_CFM_FUNCTION GetTrapAddress
- ENDIF
-
- ;
- ; pascal void SetTrapAddress(UniversalProcPtr trapAddr, UInt16 trapNum)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetTrapAddress: OPWORD $A047
- ELSE
- IMPORT_CFM_FUNCTION SetTrapAddress
- ENDIF
-
- ENDIF
- ;
- ; pascal UniversalProcPtr GetOSTrapAddress(UInt16 trapNum)
- ;
- IF ¬ GENERATINGCFM THEN
- ; parameters:
- ; trapNum => D0
- ; returns:
- ; UniversalProcPtr <= A0
- _GetOSTrapAddress: OPWORD $A346
- ELSE
- IMPORT_CFM_FUNCTION GetOSTrapAddress
- ENDIF
-
- ;
- ; pascal void SetOSTrapAddress(UniversalProcPtr trapAddr, UInt16 trapNum)
- ;
- IF ¬ GENERATINGCFM THEN
- ; parameters:
- ; trapAddr => A0
- ; trapNum => D0
- _SetOSTrapAddress: OPWORD $A247
- ELSE
- IMPORT_CFM_FUNCTION SetOSTrapAddress
- ENDIF
-
- ;
- ; pascal UniversalProcPtr GetToolTrapAddress(UInt16 trapNum)
- ;
- IF ¬ GENERATINGCFM THEN
- ; parameters:
- ; trapNum => D0
- ; returns:
- ; UniversalProcPtr <= A0
- _GetToolTrapAddress: OPWORD $A746
- ELSE
- IMPORT_CFM_FUNCTION GetToolTrapAddress
- ENDIF
-
- ;
- ; pascal void SetToolTrapAddress(UniversalProcPtr trapAddr, UInt16 trapNum)
- ;
- IF ¬ GENERATINGCFM THEN
- ; parameters:
- ; trapAddr => A0
- ; trapNum => D0
- _SetToolTrapAddress: OPWORD $A647
- ELSE
- IMPORT_CFM_FUNCTION SetToolTrapAddress
- ENDIF
-
- ;
- ; pascal UniversalProcPtr GetToolboxTrapAddress(UInt16 trapNum)
- ;
- IF ¬ GENERATINGCFM THEN
- ; parameters:
- ; trapNum => D0
- ; returns:
- ; UniversalProcPtr <= A0
- _GetToolboxTrapAddress: OPWORD $A746
- ELSE
- IMPORT_CFM_FUNCTION GetToolboxTrapAddress
- ENDIF
-
- ;
- ; pascal void SetToolboxTrapAddress(UniversalProcPtr trapAddr, UInt16 trapNum)
- ;
- IF ¬ GENERATINGCFM THEN
- ; parameters:
- ; trapAddr => A0
- ; trapNum => D0
- _SetToolboxTrapAddress: OPWORD $A647
- ELSE
- IMPORT_CFM_FUNCTION SetToolboxTrapAddress
- ENDIF
-
- ;
- ;
- ;// Moved here from StdCLib
- ;pascal Boolean TrapAvailable (UInt16 trapNumber);
- ;
- ;
- ENDIF
- ; FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
- IF FOR_SYSTEM8_PREEMPTIVE THEN
-
-
-
-
- ; typedef void * PatchableProcPtr
-
- ; typedef OptionBits PatchOptions
-
-
- kPatchEnabledBit EQU 0
- kPatchCompatibilityBit EQU 1
- kPatchOptionalBit EQU 2
-
- kPatchEnabledMask EQU $00000001
- kPatchCompatibilityMask EQU $00000002
- kPatchOptionalMask EQU $00000004
- PatchName RECORD 0
- f ds OrderedItemName
- sizeof EQU * ; size: $8 (8)
- ENDR
-
-
- ; typedef struct PatchName * PatchNamePtr
-
- PatchOrderRequirements RECORD 0
- f ds OrderRequirements
- sizeof EQU * ; size: $14 (20)
- ENDR
-
-
- ; typedef struct PatchOrderRequirements * PatchOrderRequirementsPtr
-
- PatchDescription RECORD 0
- originalRoutine ds.l 1 ; offset: $0 (0) ; A normal (probably imported) proc ptr.
- patchRoutine ds.l 1 ; offset: $4 (4) ; A normal (probably imported) proc ptr.
- thisPatchName ds PatchName ; offset: $8 (8)
- thisPatchOrdering ds PatchOrderRequirements ; offset: $10 (16)
- installOptions ds.l 1 ; offset: $24 (36)
- installResult ds.l 1 ; offset: $28 (40)
- thisPatchID ds.l 1 ; offset: $2C (44) ; Set if installed OK.
- thisCallThroughProc ds.l 1 ; offset: $30 (48) ; Set if installed OK.
- rejectingPatchID ds.l 1 ; offset: $34 (52) ; Set if there was an installation error.
- sizeof EQU * ; size: $38 (56)
- ENDR
- ; typedef struct PatchDescription * PatchDescriptionPtr
-
- ; typedef OptionBits PatchHeaderOptions
-
-
- kRequiredPatchErrorsMask EQU $00000001 ; Any installation errors in required patches?
- kOptionalPatchErrorsMask EQU $00000002 ; Any installation errors in optional patches?
-
- kPatchHeaderTag EQU 'Ptch'
- kPatchHeaderVersion EQU 1
- PatchHeader RECORD 0
- tag ds.l 1 ; offset: $0 (0) ; Must be 'Ptch'.
- version ds.l 1 ; offset: $4 (4) ; The data structure version.
- flags ds.l 1 ; offset: $8 (8) ; Set by CFM with install status.
- count ds.l 1 ; offset: $C (12) ; The total size of the "patches" array.
- patches ds.l 1 ; offset: $10 (16) ; Pointer to description array.
- sizeof EQU * ; size: $14 (20)
- ENDR
-
- kPatchInformationVersion EQU 1
- PatchInformation RECORD 0
- patchChain ds.l 1 ; offset: $0 (0)
- patchingRoutine ds.l 1 ; offset: $4 (4)
- patchOptions ds.l 1 ; offset: $8 (8)
- patchName ds PatchName ; offset: $C (12)
- patchOrder ds PatchOrderRequirements ; offset: $14 (20)
- sizeof EQU * ; size: $28 (40)
- ENDR
- ; typedef struct PatchInformation * PatchInformationPtr
-
-
- kPatchChainInformationVersion EQU 1
- PatchChainInformation RECORD 0
- kernelProcess ds.l 1 ; offset: $0 (0)
- chainRoot ds.l 1 ; offset: $4 (4)
- sizeof EQU * ; size: $8 (8)
- ENDR
- ; typedef struct PatchChainInformation * PatchChainInformationPtr
-
- ;
- ; * Maps a ProcPtr to a PatchChainID.
- ; * If the ProcPtr is a patch, return noErr and Chain
- ; * If the ProcPtr is a root, return noErr and Chain
- ; * If the ProcPtr is not a patch or a root, return an error
- ;
- ;
- ; extern OSStatus GetPatchChainFromProcPtr(KernelProcessID theKernelProcess, PatchableProcPtr theRoutine, PatchChainID *thePatchChain)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetPatchChainFromProcPtr
- ENDIF
-
- ;
- ; * Maps a ProcPtr to a PatchID.
- ; * If the ProcPtr is a patch, return noErr and the PatchID
- ; * If the ProcPtr is a root, return notAPatchErr
- ; * If the ProcPtr is not a patch or a root, return notAPatchErr
- ;
- ;
- ; extern OSStatus GetPatchFromProcPtr(KernelProcessID theKernelProcess, PatchableProcPtr theRoutine, PatchID *thePatch)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetPatchFromProcPtr
- ENDIF
-
- ;
- ; extern OSStatus GetPatchChainInformation(PatchChainID thePatchChain, PBVersion version, PatchChainInformation *patchChainInfo)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetPatchChainInformation
- ENDIF
-
- ;
- ; extern OSStatus GetPatchInformation(PatchID thePatchID, PBVersion version, PatchInformation *patchInfo)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetPatchInformation
- ENDIF
-
- ;
- ; * Iteration functions:
- ; * Get all the chains in a KernelProcess, and
- ; * Get all the patches in a chain
- ;
- ;
- ; extern OSStatus GetPatchChainsInKernelProcess(KernelProcessID theKernelProcess, ItemCount requestedPatchChains, ItemCount *totalPatchChains, PatchChainID *thePatchChains)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetPatchChainsInKernelProcess
- ENDIF
-
- ;
- ; extern OSStatus GetPatchesInPatchChain(PatchChainID thePatchChain, ItemCount requestedPatches, ItemCount *totalPatches, PatchID *thePatches)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetPatchesInPatchChain
- ENDIF
-
- ;
- ; extern OSStatus EnablePatch(PatchID thePatch)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION EnablePatch
- ENDIF
-
- ;
- ; extern OSStatus DisablePatch(PatchID thePatch)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION DisablePatch
- ENDIF
-
- ENDIF
- ENDIF ; __PATCHES__
-
-